home *** CD-ROM | disk | FTP | other *** search
- WBStartup
- NoCli
-
- ; 040/25 results with objects:
-
- ; 320x240 @25fps DoublePAL 120 16x16 objects, masked, no mask data, to any position
- ; 320x240 @25fps DoublePAL 330 16x16 objects, unmasked, to any position
- ; 320x240 @25fps DoublePAL 245 16x16 objects, masked, with mask data, to any position
-
- ; 320x240 @25fps PAL 145 16x16 objects, masked, no mask data, to any position
- ; 320x240 @25fps PAL 385 16x16 objects, unmasked, to any position
- ; 320x240 @25fps PAL 290 16x16 objects, masked, with mask data, to any position
-
- ; 320x240 @25fps PAL 150 16x16 objects, masked, no mask data, to nearest 4 pixels (block4)
- ; 320x240 @25fps PAL 410 16x16 objects, unmasked, to nearest 4 pixels (Block4)
- ; 320x240 @25fps PAL 320 16x16 objects, masked, with mask data, to nearest 4 pixels (Block4)
-
- ; 320x240 @25fps PAL 43 32x32 objects, masked, no mask data, to any position
- ; 320x240 @25fps PAL 160 32x32 objects, unmasked, to any position
- ; 320x240 @25fps PAL 100 32x32 objects, masked, with mask data, to any position
-
- ; 320x240 @25fps PAL 44 32x32 objects, masked, no mask data, to nearest 4 pixels (Block4)
- ; 320x240 @25fps PAL 170 32x32 objects, unmasked, to nearest 4 pixels (Block4)
- ; 320x240 @25fps PAL 113 32x32 objects, masked, with mask data, to nearest 4 pixels (Block4)
-
-
- ; 040/25 c2p results:
-
- ; 320x200 @49.65fps DoublePAL or 55.3fps PAL
- ; 320x256 @36.2fps DoublePAL or 42.5fps PAL
- ; 320x240 @39.5fps DoublePAL or 45.5fps PAL
-
- ; 060/50 c2p results:
-
- ; 320x256 @50fps PAL
- ; 320x200 @66.1fps PAL
-
- #c2pBPLX=320
- #c2pBPLY=240
- #c2pBPLSIZE=(#c2pBPLX*#c2pBPLY)/8
-
- #scrwidth=#c2pBPLX
- #scrheight=#c2pBPLY
- #screensize=#scrwidth*#scrheight
-
- #objwidth=8
- #objheight=8
- #objxalign=$ffff
- #objcount=100
- #objtype=3
- #objlongwidth=#objwidth/4
-
- ; c2p1x1_8_c5_040
-
- ; 110% on 040-25
-
- Statement c2p040onlyinit{A.l,B.l}
-
- ;A.l=d0=Width.w
- ;B.l=d1=Height.w
-
- ; d0.w chunkyx [chunky-pixels]
- ; d1.w chunkyy [chunky-pixels]
- ; d3.w scroffsy [screen-pixels]
-
- c2p1x1_8_c5_040_init
- LEA c2p_datanew(pc),a0
- ANDI.l #$ffff,d0
- MULU.w d0,d3
- LSR.l #3,d3
- MOVE.l d3,c2p_scroffs-c2p_data(a0)
- MULU.w d0,d1
- MOVE.l d1,c2p_pixels-c2p_data(a0)
- AsmExit
- End Statement
-
- Statement c2p040only{A.l,B.l}
-
- MOVE.l d0,a0 ; Chunky
- MOVE.l d1,a1 ; Planar
-
- ; a0 c2pscreen
- ; a1 bitplanes
-
- c2p1x1_8_c5_040
- MOVEM.l a3-a6,-(a7)
-
- MOVEM.l a0-a1,-(a7)
- LEA c2p_datanew,a0
- LEA c2p_data,a1
- MOVEQ #16-1,d0
- _c2pcopy: MOVE.l (a0)+,(a1)+
- DBF d0,_c2pcopy
- MOVEM.l (a7)+,a0-a1
- MOVE.l a7,stackstore
- MOVE.l copybuf(pc),a7
- LEA c2p_data(pc),a2
-
- MOVE.l c2p_pixels-c2p_data(a2),a3
- ADD.l a0,a3
-
- ADD.w #c2pBPLSIZE,a1
- ADD.l c2p_scroffs-c2p_data(a2),a1
- MOVE.l a1,a2
- ADD.l #c2pBPLSIZE*4,a2
-
- MOVE.l (a0),d0
- MOVE.l (a7)+,(a0)+
- MOVE.l (a0),d1
- MOVE.l (a7)+,(a0)+
- MOVE.l (a0),d2
- MOVE.l (a7)+,(a0)+
- MOVE.l (a0),d3
- MOVE.l (a7)+,(a0)+
- MOVE.l (a0),d4
- MOVE.l (a7)+,(a0)+
- MOVE.l (a0),d5
- MOVE.l (a7)+,(a0)+
-
- MOVE.l d4,d7 ; Swap 16x4, part 1
- MOVE.w d0,d4
- SWAP d4
- MOVE.w d4,d0
- MOVE.w d7,d4
- MOVE.l d5,d7
- MOVE.w d1,d5
- SWAP d5
- MOVE.w d5,d1
- MOVE.w d7,d5
-
- MOVE.l d4,d7 ; Swap 2x4, part 1
- LSR.l #2,d7
- EOR.l d0,d7
- AND.l #$33333333,d7
- EOR.l d7,d0
- LSL.l #2,d7
- EOR.l d7,d4
- MOVE.l d5,d7
- LSR.l #2,d7
- EOR.l d1,d7
- AND.l #$33333333,d7
- EOR.l d7,d1
- LSL.l #2,d7
- EOR.l d7,d5
-
- MOVE.l (a0),a5
- MOVE.l (a7)+,(a0)+
- MOVE.l (a0),a6
- MOVE.l (a7)+,(a0)+
-
- EXG d4,a5
- EXG d5,a6
-
- MOVE.l d4,d7 ; Swap 16x4, part 2
- MOVE.w d2,d4
- SWAP d4
- MOVE.w d4,d2
- MOVE.w d7,d4
- MOVE.l d5,d7
- MOVE.w d3,d5
- SWAP d5
- MOVE.w d5,d3
- MOVE.w d7,d5
-
- MOVE.l d4,d7 ; Swap 2x4, part 2
- LSR.l #2,d7
- EOR.l d2,d7
- AND.l #$33333333,d7
- EOR.l d7,d2
- LSL.l #2,d7
- EOR.l d7,d4
- MOVE.l d5,d7
- LSR.l #2,d7
- EOR.l d3,d7
- AND.l #$33333333,d7
- EOR.l d7,d3
- LSL.l #2,d7
- EOR.l d7,d5
-
- MOVE.l d1,d7 ; Swap 4x1
- LSR.l #4,d7
- EOR.l d0,d7
- AND.l #$0f0f0f0f,d7
- EOR.l d7,d0
- LSL.l #4,d7
- EOR.l d7,d1
- MOVE.l d3,d7
- LSR.l #4,d7
- EOR.l d2,d7
- AND.l #$0f0f0f0f,d7
- EOR.l d7,d2
- LSL.l #4,d7
- EOR.l d7,d3
-
- BRA _start
- _x
- MOVE.l (a0),d0
- MOVE.l (a7)+,(a0)+
- MOVE.l (a0),d1
- MOVE.l (a7)+,(a0)+
- MOVE.l (a0),d2
- MOVE.l (a7)+,(a0)+
- MOVE.l (a0),d3
- MOVE.l (a7)+,(a0)+
- MOVE.l (a0),d4
- MOVE.l (a7)+,(a0)+
- MOVE.l (a0),d5
- MOVE.l (a7)+,(a0)+
-
- MOVE.l a6,-c2pBPLSIZE(a1)
-
- MOVE.l d4,d7 ; Swap 16x4, part 1
- MOVE.w d0,d4
- SWAP d4
- MOVE.w d4,d0
- MOVE.w d7,d4
- MOVE.l d5,d7
- MOVE.w d1,d5
- SWAP d5
- MOVE.w d5,d1
- MOVE.w d7,d5
-
- MOVE.l d4,d7 ; Swap 2x4, part 1
- LSR.l #2,d7
- EOR.l d0,d7
- AND.l #$33333333,d7
- EOR.l d7,d0
- LSL.l #2,d7
- EOR.l d7,d4
- MOVE.l d5,d7
- LSR.l #2,d7
- EOR.l d1,d7
- AND.l #$33333333,d7
- EOR.l d7,d1
- LSL.l #2,d7
- EOR.l d7,d5
-
- MOVE.l (a0),d7
- MOVE.l (a7)+,(a0)+
- MOVE.l (a0),a6
- MOVE.l (a7)+,(a0)+
-
- MOVE.l a5,-c2pBPLSIZE(a2)
-
- MOVE.l d7,a5
- EXG d4,a5
- EXG d5,a6
-
- MOVE.l d4,d7 ; Swap 16x4, part 2
- MOVE.w d2,d4
- SWAP d4
- MOVE.w d4,d2
- MOVE.w d7,d4
- MOVE.l d5,d7
- MOVE.w d3,d5
- SWAP d5
- MOVE.w d5,d3
- MOVE.w d7,d5
-
- MOVE.l d4,d7 ; Swap 2x4, part 2
- MOVE.l d6,(a2)+
- LSR.l #2,d7
- EOR.l d2,d7
- AND.l #$33333333,d7
- EOR.l d7,d2
- LSL.l #2,d7
- EOR.l d7,d4
- MOVE.l d5,d7
- LSR.l #2,d7
- EOR.l d3,d7
- AND.l #$33333333,d7
- EOR.l d7,d3
- LSL.l #2,d7
- EOR.l d7,d5
-
- MOVE.l d1,d7 ; Swap 4x1
- LSR.l #4,d7
- EOR.l d0,d7
- MOVE.l a4,(a1)+
- AND.l #$0f0f0f0f,d7
- EOR.l d7,d0
- LSL.l #4,d7
- EOR.l d7,d1
- MOVE.l d3,d7
- LSR.l #4,d7
- EOR.l d2,d7
- AND.l #$0f0f0f0f,d7
- EOR.l d7,d2
- LSL.l #4,d7
- EOR.l d7,d3
- _start
-
- MOVE.l d2,d7 ; Swap 8x2, part 1
- LSR.l #8,d7
- EOR.l d0,d7
- AND.l #$00ff00ff,d7
- EOR.l d7,d0
- LSL.l #8,d7
- EOR.l d7,d2
- MOVE.l d2,d7
- LSR.l #1,d7 ; Swap 1x2, part 1
- EOR.l d0,d7
- AND.l #$55555555,d7
- EOR.l d7,d0
- MOVE.l d0,c2pBPLSIZE*2(a2)
- ADD.l d7,d7
- EOR.l d7,d2
- MOVE.l d3,d7 ; Swap 8x2, part 2
- LSR.l #8,d7
- EOR.l d1,d7
- AND.l #$00ff00ff,d7
- EOR.l d7,d1
- LSL.l #8,d7
- EOR.l d7,d3
- MOVE.l d3,d7
- LSR.l #1,d7 ; Swap 1x2, part 2
- EOR.l d1,d7
- AND.l #$55555555,d7
- EOR.l d7,d1
- MOVE.l d1,c2pBPLSIZE*2(a1)
- ADD.l d7,d7
- EOR.l d7,d3
-
- MOVE.l d5,d7
- LSR.l #4,d7
- EOR.l d4,d7
- AND.l #$0f0f0f0f,d7
- EOR.l d7,d4
- LSL.l #4,d7
- EOR.l d7,d5
-
- EXG d4,a5
- EXG d5,a6
-
- MOVE.l d5,d7
- LSR.l #4,d7
- EOR.l d4,d7
- AND.l #$0f0f0f0f,d7
- EOR.l d7,d4
- LSL.l #4,d7
- EOR.l d7,d5
-
- MOVE.l a5,d0
- MOVE.l a6,d1
- MOVE.l d2,c2pBPLSIZE(a2)
-
-
- MOVE.l d0,d7 ; Swap 8x2, part 3
- LSR.l #8,d7
- EOR.l d4,d7
- AND.l #$00ff00ff,d7
- EOR.l d7,d4
- LSL.l #8,d7
- EOR.l d7,d0
- MOVE.l d0,d7
- LSR.l #1,d7 ; Swap 1x2, part 3
- EOR.l d4,d7
- AND.l #$55555555,d7
- EOR.l d7,d4
- ADD.l d7,d7
- EOR.l d7,d0
- MOVE.l d1,d7 ; Swap 8x2, part 4
- LSR.l #8,d7
- MOVE.l d3,c2pBPLSIZE(a1)
- EOR.l d5,d7
- AND.l #$00ff00ff,d7
- EOR.l d7,d5
- LSL.l #8,d7
- EOR.l d7,d1
- MOVE.l d1,d7
- LSR.l #1,d7 ; Swap 1x2, part 4
- EOR.l d5,d7
- AND.l #$55555555,d7
- EOR.l d7,d5
- ADD.l d7,d7
- EOR.l d7,d1
-
- MOVE.l d0,a5
- MOVE.l d1,a6
-
- MOVE.l d4,d6
- MOVE.l d5,a4
-
- CMP.l a0,a3
- BNE _x
-
- MOVE.l a6,-c2pBPLSIZE(a1)
- MOVE.l a5,-c2pBPLSIZE(a2)
- MOVE.l d6,(a2)+
- MOVE.l a4,(a1)+
- MOVE.l stackstore(pc),a7
- MOVEM.l (a7)+,a3-a6
- AsmExit
-
- Even4
- stackstore: Dc.l 0
- copybuf: Dc.l 0
- c2p_data
- c2p_scroffs: Dc.l 0
- c2p_pixels: Dc.l 0
- Ds.l 16
- Even4
- c2p_datanew
- Ds.l 16
- End Statement
-
- Statement chunkyshape1{A.l,B.l,C.l,D.l}
- .chunkyshape1
- ;32x32 any position masked on the fly
- MULU #320,d3
- MOVE.l d0,a0
- ADD.l d2,d3
- ADD.l d3,d1
- MOVE.l d1,a1
- MOVEQ.l #objwidth-1,d2 ; d2=yloop
- MOVEQ.l #8,d5 ; temp for speed
- yloop
- MOVEQ.l #objlongwidth-1,d3 ; xloop
- xloop
- MOVE.l (a0),d6 ; Store gfx (cache?)
- MOVE.b (a0)+,d4 ; source
- SEQ.b d4 ; mask
- ROL.l d5,d4 ; rotate
- MOVE.b (a0)+,d4 ; source
- SEQ.b d4 ; mask
- ROL.l d5,d4 ; rotate
- MOVE.l (a1),d7 ; get dest
- MOVE.b (a0)+,d4 ; source
- SEQ.b d4 ; mask
- ROL.l d5,d4 ; rotate
- MOVE.b (a0)+,d4 ; source
- SEQ.b d4 ; mask
- ROL.l d5,d4 ; rotate
- AND.l d4,d7 ; cut
- OR.l d6,d7 ; paste
- MOVE.l d7,(a1)+ ; Output
- DBRA d3,xloop
- ADD.l #320-32,a1 ; line modulo
- DBRA d2,yloop
- AsmExit
- End Statement
-
- Statement chunkyshape2{A.l,B.l,C.l,D.l}
- .chunkyshape2
- ;32x32 any position non-masked
- MULU #320,d3
- MOVE.l d0,a0
- ADD.l d2,d3
- ADD.l d3,d1
- MOVE.l d1,a1
- MOVEQ.l #objwidth-1,d2
- MOVEQ.l #8,d5
- MOVE.l #320-objwidth,d3
- yloop2
- MOVEQ.l #objlongwidth-1,d4
- xloop2
- MOVE.l (a0)+,(a1)+
- DBRA d4,xloop2
- ADD.l d3,a1
- DBRA d2,yloop2
- AsmExit
- End Statement
-
- Statement chunkyshape3{A.l,B.l,C.l,D.l,E.l}
- .chunkyshape3
- ;32x32 any position masked with mask data
- ;needs Bank(3) as the second param
- MULU #320,d4
- MOVE.l d0,a0 ; input
- ADD.l d3,d4
- MOVE.l d1,a2 ; mask
- ADD.l d4,d2
- MOVE.l d2,a1 ; output
- MOVEQ.l #objwidth-1,d2
- MOVE.l #320-objwidth,d3
- yloop3
- MOVEQ.l #objlongwidth-1,d4
- xloop3
- MOVE.l (a2)+,d0
- AND.l d0,(a1)
- MOVE.l (a0)+,d1
- OR.l d1,(a1)+
- DBRA d4,xloop3
- ADD.l d3,a1
- DBRA d2,yloop3
- AsmExit
- End Statement
-
- .blitzprogram
- ; Setup
- InitBank 1,#scrwidth*#scrheight,$10000 ; Fastram chunky buffer
- InitBank 4,#scrwidth*#scrheight,$10000 ; Fastram background buffer
- GetReg d0,Bank(4)
- MOVE.l d0,copybuf
- BLoad "320x256x256.chunky",Bank(4),#scrwidth*#scrheight
- LoadPalette 0,"320x256x256.palette"
- InitBank 0,(#scrwidth*#scrheight)+1000,2|65536 ; Chipram planar buffer
- CludgeBitMap 0,#scrwidth,#scrheight,8,Bank(0)
- Screen 0,0,0,#scrwidth,#scrheight,8,0,"c2p test",0,0,0
- Use Palette 0
- VWait 50
-
- ; chunky shape
- InitBank 2,#objwidth*#objheight,$10000 ; chunky shape
- For o=0 To (#objwidth*#objheight)-1
- Poke.b Bank(2)+o,Rnd(255)
- Next o
-
- ; chunky mask
- InitBank 3,#objwidth*#objheight,$10000 ; chunky mask
- For o=0 To (#objwidth*#objheight)-1
- If Peek.b(Bank(2)+o)=0 Then Poke.b Bank(3)+o,$ff Else Poke.b Bank(3)+o,$0
- Next o
-
- ; Do the c2p test
- c2p040onlyinit{#scrwidth,#scrheight}
- VWait 20
- Forbid_
- VWait
- If #objtype=1
- ResetTimer
- For time=1 To 800
- For cs=1 To #objcount
- chunkyshape1{Bank(2),Bank(1),Rnd(#scrwidth-#objwidth-4)objxalign,Rnd(#scrheight-#objheight-4)}
- Next cs
- c2p040only{Bank(1),Bank(0)} ; Convert chunky to planar
- Next time
- t=Ticks
- Else
- If #objtype=2
- ResetTimer
- For time=1 To 800
- For cs=1 To #objcount
- chunkyshape2{Bank(2),Bank(1),Rnd(#scrwidth-#objwidth-4)objxalign,Rnd(#scrheight-#objheight-4)}
- Next cs
- c2p040only{Bank(1),Bank(0)} ; Convert chunky to planar
- Next time
- t=Ticks
- Else
- If #objtype=3
- ResetTimer
- For time=1 To 800
- For cs=1 To #objcount
- chunkyshape3{Bank(2),Bank(3),Bank(1),Rnd(#scrwidth-#objwidth-4)objxalign,Rnd(#scrheight-#objheight-4)}
- Next cs
- c2p040only{Bank(1),Bank(0)} ; Convert chunky to planar
- Next time
- t=Ticks
- EndIf
- EndIf
- EndIf
-
- VWait 2 : Permit_
- VWait 20
- FindScreen 0
- Window 0,0,11,640,100,0,"Test results for c2p",0,0
- WindowOutput 0
- per.f=1/(t/800)
- NPrint "Routine performed @ ",50/(t/800),"fps - ",t," ticks - ",per," per frame"
- NPrint " "
- NPrint "Press mousebutton..."
- Free Screen 0
- MouseWait
- Free Window 0
- End
-
-